<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib prefix="custom" tagdir="/WEB-INF/tags" %>
<html>
<head>
    <title>报表规则</title>
</head>
<body>
<div class="pageheader">
    <h2>编辑报表规则</h2>
</div>
<div class="contentpanel">
    <div class="panel panel-default">
        <form:form commandName="formDto" cssClass="form-horizontal form-bordered">
            <div class="form-group">
                <label class="col-sm-3 control-label">规则名称</label>

                <div class="col-sm-6">
                    <form:input path="name" cssClass="form-control" rows="10" placeholder="规则名称"/>
                    <form:errors path="name" cssClass="error text-danger"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">sql</label>

                <div class="col-sm-6">
                    <form:textarea path="sql" cssClass="form-control" rows="10" placeholder="sql"/>
                    <form:errors path="sql" cssClass="error text-danger"/>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">
                    内容
                        <span class="fa fa-info-circle" data-container="body" data-toggle="popover"
                              data-placement="right"
                              data-content="<b>注入参数:</b><br/>
                            <p><b>member</b>:当前粉丝</p>
                            <p><b>currentDateTime</b>:当前时间</p>
                            <p><b>user</b>:当前用户</p>
                            <p><b>userAccount</b>:当前账号</p>
                            <p><b>employee</b>:当前员工</p>
                            <p><b>dept</b>:当前员工的部门</p>
                            <p><b>deptUuids</b>:当前员工的子部门的uuid</p>
                            <p><b>reportRuleDept</b>:当前报表规则所属的部门</p>
                            <p><b>parameterMap</b>:当前请求所带参数</p>
                            "></span>
                </label>

                <div class="col-sm-6">
                    <form:textarea path="content" rows="30" cssClass="form-control"
                                   placeholder="内容"/>
                    <form:errors path="content" cssClass="error text-danger"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">部门</label>

                <div class="col-sm-6">
                    <custom:dept_tree_list list="${formDto.childDept}" index="0" name="deptUuid"/>
                    <custom:dept_tree_input_list list="${formDto.childDept}" index="0" name=""/>
                    <form:errors path="deptUuid" cssClass="error text-danger"/>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label"></label>

                <div class="col-sm-6">
                    <button type="submit" class="btn btn-primary">提交</button>
                    <a href="javascript:window.history.go(-1);" class="btn btn-default">取消</a>
                </div>
            </div>
        </form:form>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $('[data-toggle="popover"]').popover({html: true});
    })
</script>
</body>
</html>
